export default {
	apiUrl: '',
	template: ``,
	data: function() {
		return {
			reqParam:'',/* reqParam:父组件参数（保留属性名） */
			content:'empty',
			timeid:999,
			isOpen:true,
			winHeight:'300',
			winWidth:'900',
			title:''
		}
	},
	created(){
		//数据初始化
		var date = new Date();
		var height = document.documentElement.clientHeight;
		this.child = null;
		this.winHeight = (height<320?height:(height-320));
		this.isOpen = true;
		this.timeid = (date.getHours()<10 ? '0' + date.getHours(): '' + date.getHours())
			+ (date.getMinutes()<10 ? '0' + date.getMinutes(): '' + date.getMinutes()) 
			+ (date.getSeconds()<10 ? '0' + date.getSeconds(): '' + date.getSeconds());
		if(!!this.reqParam.width){
			this.winWidth = this.reqParam.width;
		}
		this.title = this.reqParam.title;
	},
	mounted(){
		var this_ = this;
		ComponentUtil.build({
			url : this.reqParam.url,
			parentInst: this ,//父组件vue组件实例
			componentSlot: 'content',
			reqParam: this.reqParam.reqParam,
			parentCallback:function(child){
				this_.child = child;
			}
		});
	},
	methods: {
		/* 父组件回调*/
		parentCallback(param){},
		close(){
			var this_ = this;
			this.isOpen = false;
			setTimeout(function() {
				this_.content = 'empty';
				this_.reqParam.dialogParentInst[this_.reqParam.dialogComponentSlot] = 'empty';
			}, 150);
		},
		save(){
			console.log('获取子组件的表单信息，提交');
			var formdata = this.child.formdata;
			var url = this.child.url;
			//提交表单
			console.log(this.child);
			
		}
	}
}